\hypertarget{class_cv_image_capture}{
\section{CvImageCapture Class Reference}
\label{class_cv_image_capture}\index{CvImageCapture@{CvImageCapture}}
}


\hyperlink{class_video}{Video} Capture interface that supports USB/Firewire DV cameras and video files.  


{\ttfamily \#include $<$cvimagecapture.h$>$}\subsection*{Classes}
\begin{DoxyCompactItemize}
\item 
class \hyperlink{class_cv_image_capture_1_1_image}{Image}
\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{class_cv_image_capture_a187f33a934b9a8911df276a6964f0499}{
\hyperlink{class_cv_image_capture_a187f33a934b9a8911df276a6964f0499}{CvImageCapture} ()}
\label{class_cv_image_capture_a187f33a934b9a8911df276a6964f0499}

\begin{DoxyCompactList}\small\item\em Constructor. \item\end{DoxyCompactList}\item 
\hypertarget{class_cv_image_capture_a0711477039f8880e803ff6de426ac15e}{
\hyperlink{class_cv_image_capture_a0711477039f8880e803ff6de426ac15e}{$\sim$CvImageCapture} ()}
\label{class_cv_image_capture_a0711477039f8880e803ff6de426ac15e}

\begin{DoxyCompactList}\small\item\em Destructor. \item\end{DoxyCompactList}\item 
int \hyperlink{class_cv_image_capture_a1a7f83a8dce73aa7a0ceafdd329a6c3a}{Start} (const std::string \&videoSource, const int width=0, const int height=0, const bool interlace=false, const bool useDefaultCaptureLib=true)
\begin{DoxyCompactList}\small\item\em Use this method to start capture from a video source. \item\end{DoxyCompactList}\item 
int \hyperlink{class_cv_image_capture_a55400b26e53ac068db5bd0e16f6ee3dc}{Stop} ()
\begin{DoxyCompactList}\small\item\em Stops video capture. \item\end{DoxyCompactList}\item 
int \hyperlink{class_cv_image_capture_a6ba5f4c2c6b07bc4a749c97be16f5102}{GetFrame} (\hyperlink{class_cv_image_capture_1_1_image}{CvImageCapture::Image} $\ast$dest, const bool block=false)
\begin{DoxyCompactList}\small\item\em Use this method to get the current frame from the camera/video source. \item\end{DoxyCompactList}\item 
bool \hyperlink{class_cv_image_capture_a1f3e6b138f52cb5f7bc90b4d10f1f4a8}{IsReady} () const 
\end{DoxyCompactItemize}
\subsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
static unsigned int \hyperlink{class_cv_image_capture_ae3d33b009c58a457fbf5ccaa08425ff9}{ScanForSources} (std::vector$<$ std::string $>$ \&sources)
\begin{DoxyCompactList}\small\item\em This method is used to scan for video devices on the system. \item\end{DoxyCompactList}\item 
static bool \hyperlink{class_cv_image_capture_a266c9920d6511bd3f8e142cd98809713}{DeInterlaceData} (unsigned char $\ast$src, unsigned char $\ast$dest, unsigned short width, unsigned short height)
\begin{DoxyCompactList}\small\item\em This method is used to de-\/interlace an interlaced image using interpolation. \item\end{DoxyCompactList}\item 
\hypertarget{class_cv_image_capture_a82a46664651182c02c566435a8cab5bf}{
static void {\bfseries FlipChannels} (\hyperlink{class_cv_image_capture_1_1_image}{Image} \&image)}
\label{class_cv_image_capture_a82a46664651182c02c566435a8cab5bf}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
\hyperlink{class_video}{Video} Capture interface that supports USB/Firewire DV cameras and video files. Required Libraries: Windows: DirectX 9 SDK, Windows Platform SDK (DirectShow) if compiling, otherwise just use the produced DLL as is. Linux: LibV4L 

\subsection{Member Function Documentation}
\hypertarget{class_cv_image_capture_a266c9920d6511bd3f8e142cd98809713}{
\index{CvImageCapture@{CvImageCapture}!DeInterlaceData@{DeInterlaceData}}
\index{DeInterlaceData@{DeInterlaceData}!CvImageCapture@{CvImageCapture}}
\subsubsection[{DeInterlaceData}]{\setlength{\rightskip}{0pt plus 5cm}static bool CvImageCapture::DeInterlaceData (unsigned char $\ast$ {\em src}, \/  unsigned char $\ast$ {\em dest}, \/  unsigned short {\em width}, \/  unsigned short {\em height})\hspace{0.3cm}{\ttfamily  \mbox{[}inline, static\mbox{]}}}}
\label{class_cv_image_capture_a266c9920d6511bd3f8e142cd98809713}


This method is used to de-\/interlace an interlaced image using interpolation. 
\begin{DoxyParams}{Parameters}
\item[\mbox{$\leftarrow$} {\em src}]Source image data \mbox{[}3 channels RGB\mbox{]}. \item[\mbox{$\rightarrow$} {\em dest}]The resulting de-\/interlaced image (must be pre-\/allocated). \item[\mbox{$\leftarrow$} {\em width}]\hyperlink{class_cv_image_capture_1_1_image}{Image} width in pixels. \item[\mbox{$\leftarrow$} {\em height}]\hyperlink{class_cv_image_capture_1_1_image}{Image} height in pixels.\end{DoxyParams}
\begin{DoxyReturn}{Returns}
True on success, false on failure. 
\end{DoxyReturn}
\hypertarget{class_cv_image_capture_a6ba5f4c2c6b07bc4a749c97be16f5102}{
\index{CvImageCapture@{CvImageCapture}!GetFrame@{GetFrame}}
\index{GetFrame@{GetFrame}!CvImageCapture@{CvImageCapture}}
\subsubsection[{GetFrame}]{\setlength{\rightskip}{0pt plus 5cm}int CvImageCapture::GetFrame ({\bf CvImageCapture::Image} $\ast$ {\em dest}, \/  const bool {\em block} = {\ttfamily false})}}
\label{class_cv_image_capture_a6ba5f4c2c6b07bc4a749c97be16f5102}


Use this method to get the current frame from the camera/video source. 
\begin{DoxyParams}{Parameters}
\item[\mbox{$\rightarrow$} {\em Pointer}]to image structure to fill with current frame. \item[\mbox{$\leftarrow$} {\em block}]If true, this method will block until a new frame arrives otherwise it will fall through if a new frame isn't available.\end{DoxyParams}
\begin{DoxyReturn}{Returns}
1 on success, 0 on failure. 
\end{DoxyReturn}
\hypertarget{class_cv_image_capture_a1f3e6b138f52cb5f7bc90b4d10f1f4a8}{
\index{CvImageCapture@{CvImageCapture}!IsReady@{IsReady}}
\index{IsReady@{IsReady}!CvImageCapture@{CvImageCapture}}
\subsubsection[{IsReady}]{\setlength{\rightskip}{0pt plus 5cm}bool CvImageCapture::IsReady () const}}
\label{class_cv_image_capture_a1f3e6b138f52cb5f7bc90b4d10f1f4a8}
\begin{DoxyReturn}{Returns}
True if ready to capture image data, false otherwise. 
\end{DoxyReturn}
\hypertarget{class_cv_image_capture_ae3d33b009c58a457fbf5ccaa08425ff9}{
\index{CvImageCapture@{CvImageCapture}!ScanForSources@{ScanForSources}}
\index{ScanForSources@{ScanForSources}!CvImageCapture@{CvImageCapture}}
\subsubsection[{ScanForSources}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int CvImageCapture::ScanForSources (std::vector$<$ std::string $>$ \& {\em sources})\hspace{0.3cm}{\ttfamily  \mbox{[}static\mbox{]}}}}
\label{class_cv_image_capture_ae3d33b009c58a457fbf5ccaa08425ff9}


This method is used to scan for video devices on the system. 
\begin{DoxyParams}{Parameters}
\item[\mbox{$\rightarrow$} {\em sources}]\hyperlink{class_video}{Video} sources on the computer.\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Number of sources detected. 
\end{DoxyReturn}
\hypertarget{class_cv_image_capture_a1a7f83a8dce73aa7a0ceafdd329a6c3a}{
\index{CvImageCapture@{CvImageCapture}!Start@{Start}}
\index{Start@{Start}!CvImageCapture@{CvImageCapture}}
\subsubsection[{Start}]{\setlength{\rightskip}{0pt plus 5cm}int CvImageCapture::Start (const std::string \& {\em videoSource}, \/  const int {\em width} = {\ttfamily 0}, \/  const int {\em height} = {\ttfamily 0}, \/  const bool {\em interlace} = {\ttfamily false}, \/  const bool {\em useDefaultCaptureLib} = {\ttfamily true})}}
\label{class_cv_image_capture_a1a7f83a8dce73aa7a0ceafdd329a6c3a}


Use this method to start capture from a video source. 
\begin{DoxyParams}{Parameters}
\item[\mbox{$\leftarrow$} {\em videoSource}]Camera/Video source name or file path. Examples: \char`\"{}/dev/video0\char`\"{} or \char`\"{}Logitech Pro 9000\char`\"{}. \item[\mbox{$\leftarrow$} {\em width}]Desired image capture width. If set to 0, then the default settings for the camera are used (default value). \item[\mbox{$\leftarrow$} {\em height}]Desired image capture height. If set to 0 then the default settings for the camera are used (default value). \item[\mbox{$\leftarrow$} {\em interlace}]If the image data is interlaced, this flag will enable automatic de-\/interlacing. \item[\mbox{$\leftarrow$} {\em useDefaultCaptureLib}]If true, the default capture library wrapped by this class is used, otherwise an alternate. (e.g. libv4l in Linux).\end{DoxyParams}
\begin{DoxyReturn}{Returns}
1 on success, 0 on failure.
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
\item[\mbox{$\leftarrow$} {\em videoSource}]Camera/Video source name or file path. Examples: \char`\"{}/dev/video0\char`\"{} or \char`\"{}Logitech Pro 9000\char`\"{} or a number \char`\"{}0\char`\"{}, \char`\"{}1\char`\"{} for the camera number. \item[\mbox{$\leftarrow$} {\em width}]Desired image capture width. If set to 0, then the default settings for the camera are used (default value). \item[\mbox{$\leftarrow$} {\em height}]Desired image capture height. If set to 0 then the default settings for the camera are used (default value). \item[\mbox{$\leftarrow$} {\em interlace}]If the image data is interlaced, this flag will enable automatic de-\/interlacing. \item[\mbox{$\leftarrow$} {\em useDefaultCaptureLib}]If true, the default capture library wrapped by this class is used, otherwise an alternate. (e.g. libv4l in Linux).\end{DoxyParams}
\begin{DoxyReturn}{Returns}
1 on success, 0 on failure. 
\end{DoxyReturn}
\hypertarget{class_cv_image_capture_a55400b26e53ac068db5bd0e16f6ee3dc}{
\index{CvImageCapture@{CvImageCapture}!Stop@{Stop}}
\index{Stop@{Stop}!CvImageCapture@{CvImageCapture}}
\subsubsection[{Stop}]{\setlength{\rightskip}{0pt plus 5cm}int CvImageCapture::Stop ()}}
\label{class_cv_image_capture_a55400b26e53ac068db5bd0e16f6ee3dc}


Stops video capture. \begin{DoxyReturn}{Returns}
1 on succes, 0 on failure. 
\end{DoxyReturn}


The documentation for this class was generated from the following files:\begin{DoxyCompactItemize}
\item 
C:/Users/Matt/Documents/School/Robotics/zebulon/v2/cv/include/cv/cvimagecapture.h\item 
C:/Users/Matt/Documents/School/Robotics/zebulon/v2/cv/src/cv/cvimagecapturelinux.cpp\item 
C:/Users/Matt/Documents/School/Robotics/zebulon/v2/cv/src/cv/cvimagecapturewindows.cpp\end{DoxyCompactItemize}
